package com.eight.cloud.openfeign.admin.api;

import com.eight.cloud.openfeign.admin.vo.permission.PermissionTree;
import com.eight.cloud.core.global.result.Result;
import com.eight.cloud.openfeign.admin.factory.SystemFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @InterfaceName: SystemClient
 * @Author: TXC
 * @Date: 2025-02-14 16:32
 **/
@FeignClient(value = "cloud-admin", contextId = "systemClient", fallbackFactory = SystemFallbackFactory.class)
public interface SystemClient {
    /**
     * 初始化系统
     * @return 结果
     */
    @GetMapping("/system/init")
    Result<String> initSystem();

    /**
     * 刷新权限
     * @return 结果
     */
    @PostMapping("/system/flushPermission")
    Result<String> flushPermission(@RequestBody PermissionTree permissionTree);
}
